//
//  ST_AICenterPeculiarityEmptyCell.swift
//  btvideo
//
//  Created by mac on 2020/3/17.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwifterSwift
import SnapKit
import SwiftyAttributes

class ST_AICenterPeculiarityEmptyCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(50)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(conten_label)
        conten_label.snp.makeConstraints { (make) in
            make.top.equalTo(titleLabel.snp.bottom).offset(20)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(add_btn)
        add_btn.snp.makeConstraints { (make) in
            make.top.equalTo(conten_label.snp.bottom).offset(25)
            make.centerX.equalToSuperview()
            make.width.equalTo(162)
            make.height.equalTo(35)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - Properties
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel.init()
        control.text = "添加你的特质吧"
        control.textColor = Color.init(hexString: "#333333")
        control.font = UIFont.systemFont(ofSize: 22, weight: UIFont.Weight.semibold)
        return control
    }()
    
    fileprivate lazy var conten_label:UILabel = {
        let control = UILabel.init()
        control.text = "首页展示你的闪光点，释放你的魅力与吸引力\n获得大量喜欢吧！"
        control.numberOfLines = 0
        control.textAlignment = .center
        control.textColor = Color.init(hexString: "#61666F")
        control.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)
        return control
    }()
    
    fileprivate lazy var add_btn:UIButton = {
        
        let control = UIButton.init(type: UIButton.ButtonType.custom)
        control.backgroundColor = Color.init(hexString: "#F2F4F7")
        control.cornerRadius = 35/2.0
        control.setTitleForAllStates("添加特质")
        control.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: UIFont.Weight.semibold)
        control.setTitleColorForAllStates(UIColor.init(hexString: "#333333")!)
        control.addTarget(self, action: #selector(add_handle), for: UIControl.Event.touchUpInside)
        return control
    }()
    
}

extension ST_AICenterPeculiarityEmptyCell{
    
    @objc func add_handle(){
                
        push_to_push_peculiarity_controller(navigationController: self.parentViewController?.navigationController)
        
    }
    
}

//MARK: - 添加 特质CELL

class ST_AICenterAppendST_PeculiarityCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(push_peculiarity_btn)
        push_peculiarity_btn.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0))
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate lazy var push_peculiarity_btn:ST_PushSheetView = {
            
        let control = ST_PushSheetView()
        
        control.model = ST_PushSheetViewModel.createPec()
        
        control.addTarget(self, action: #selector(push_peculiarity_handle), for: .touchUpInside)
        return control
    }()
    
    @objc fileprivate func push_peculiarity_handle(){
        
        push_to_push_peculiarity_controller(navigationController: self.parentViewController?.navigationController)
        
    }
}


//MARK: - 日常为空
class ST_AICenterDailyEmptyCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(50)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(conten_label)
        conten_label.snp.makeConstraints { (make) in
            make.top.equalTo(titleLabel.snp.bottom).offset(20)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(add_btn)
        add_btn.snp.makeConstraints { (make) in
            make.top.equalTo(conten_label.snp.bottom).offset(25)
            make.centerX.equalToSuperview()
            make.width.equalTo(162)
            make.height.equalTo(35)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - Properties
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel.init()
        control.text = "发布你的第一条日常吧"
        control.textColor = Color.init(hexString: "#333333")
        control.font = UIFont.systemFont(ofSize: 22, weight: UIFont.Weight.semibold)
        return control
    }()
    
    fileprivate lazy var conten_label:UILabel = {
        let control = UILabel.init()
        control.text = "每天都有各种各样的情绪、事情？哪怕是再小的事，\n也分享出来同大家讨论吧！"
        control.numberOfLines = 0
        control.textAlignment = .center
        control.textColor = Color.init(hexString: "#61666F")
        control.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)
        return control
    }()
    
    fileprivate lazy var add_btn:UIButton = {
        
        let control = UIButton.init(type: UIButton.ButtonType.custom)
        control.backgroundColor = Color.init(hexString: "#F2F4F7")
        control.cornerRadius = 35/2.0
        control.setTitleForAllStates("发布日常")
        control.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: UIFont.Weight.semibold)
        control.setTitleColorForAllStates(UIColor.init(hexString: "#333333")!)
        control.addTarget(self, action: #selector(add_handle), for: UIControl.Event.touchUpInside)
        return control
    }()
    
}

extension ST_AICenterDailyEmptyCell{
    
    @objc func add_handle(){
                
//        let alert = ST_PushOptionViewController()
//
//        alert.overCurrentContext = true
//
//        alert.over_current_context_alpha = "0.4"
//
//        GlobalPresent(toController: alert)
        
//        push_to_push_peculiarity_controller(navigationController: ST_BTLaunchController.shared.navigationController)
        
        let vc = ST_SelectDailyMomentController()
        
        vc.title = "选择日常类型"
        
        ST_BTLaunchController.shared.navigationController?.pushViewController(vc)
    }
    
}


//MARK: - 喜欢 为空
class ST_AICenterLovedEmptyCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(50)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(conten_label)
        conten_label.snp.makeConstraints { (make) in
            make.top.equalTo(titleLabel.snp.bottom).offset(20)
            make.centerX.equalToSuperview()
        }
        
        contentView.addSubview(action_btn)
        action_btn.snp.makeConstraints { (make) in
            make.width.equalTo(162)
            make.height.equalTo(35)
            make.top.equalTo(conten_label.snp.bottom).offset(25)
            make.centerX.equalToSuperview()
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - Properties
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel.init()
        control.text = "你还未点赞收藏任何内容"
        control.textColor = Color.init(hexString: "#333333")
        control.font = UIFont.systemFont(ofSize: 22, weight: UIFont.Weight.semibold)
        return control
    }()
    
    fileprivate lazy var conten_label:UILabel = {
        let control = UILabel()
        
        let p = NSParagraphStyle.create_line_spacing_paragraph_style(lineSpacing: 3)
        p.alignment = .center
        
        let str  = "一辈子很短，遇到喜欢的东西一定要收藏起来，\n慢慢回味！".withAttributes([Attribute.textColor(Color.init(hexString: "#61666F")!),.font(UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)),Attribute.paragraphStyle(p)])
        
        control.numberOfLines = 0
        
        control.attributedText = str
        
        return control
    }()
    
    fileprivate lazy var action_btn:UIButton = {
            
            let control = UIButton.init(type: UIButton.ButtonType.custom)
            control.backgroundColor = UIColor(hex: 0xF2F4F7)
            control.cornerRadius = 35/2.0
                control.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: UIFont.Weight.semibold)
            control.setTitleForAllStates("去广场")
            control.setTitleColor(UIColor(hex: 0x333333), for: UIControl.State.normal)
            control.addTarget(self, action: #selector(action_handle), for: UIControl.Event.touchUpInside)
            return control
        }()

    @objc func action_handle(){
        
        ST_BTLaunchController.shared.scroll_to_page(tab: .square)
    }
}
